<%@page import="org.hibernate.validator.constraints.SafeHtml.Tag"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目产品详情</title>
<jsp:include page="../../import.jsp" flush="true" />
<style>
.moreGps{
width:398px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
-ms-border-radius:4px;
-khtml-border-radius:4px;
border-radius:4px;
}
</style>
</head>
<body class="iframeBody">
<div class="Wrapper">
  <div>
<div id="pageInTab" class="pageInTab">
   	 	<form id="basePrdForm1">
     	<div tabid="tabA" title="产品基本信息" lselected="true">
       			<div class="fieldset1 tabel_col clearFix">
       			   <div class="caption">
                                <span class="title">主车配置</span>
                    </div>
               		 <div style="display: none">
               		 	<input name="mfrId" id="mfrId" type="hidden"  value=""  class="ui-textbox"  disabled="disabled">
               		 	<input name="prdbscInfoId" id="prdbscInfoId"  type="hidden"  value="${prjPrd.id}"   class="ui-textbox"  disabled="disabled">
               		 	<input name="carId" id="carId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="tkId" id="tkId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="prdId" id="prdId"  type="hidden"  value="${prjPrd.prdId}"   class="ui-textbox"  disabled="disabled">
               		 	<input name="prdCd" id="prdCd"  type="hidden"  value="${prjPrd.prdCd}"   class="ui-textbox"  disabled="disabled">
               		 	<input name="detailId" id="detailId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	 <input name="basePrdId" id="basePrdId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	 <input name="styleId" id="styleId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">

               		 </div>
                   	<div class="fieldBox col_33" >
	                        	<div class="label">产品名称</div>
				                <div class="field">
				                	<input name="prdNm" id="prdNm" type="text"  value="${dtlVO.prdNm}"  class="ui-textbox"  readonly="readonly">
				                </div>
				           </div>
				              <div class="fieldBox col_33" >
	                        	<div class="label">产品品牌</div>
				                <div class="field">
				                	<input type="text" id="brCd"  name="brCd"  value="${prjPrd.brCd}"  class="ui-textbox"  readonly="readonly">
				                	<%-- <input name="brCd"  id="brCd"  type="text"  value="${prd.prjPrdBscInfo.brCd}"  class="ui-textbox"  readonly="readonly"> --%>
				                </div>
				           </div>
				      
				                 <div class="fieldBox col_33">
                                <div class="label">品牌类别</div>
                                <div class="field">
									<input type="text"   name="brTypCd"  value="${prd.brTypCd}"  class="ui-textbox"  readonly="readonly">
                                </div>
                            </div> 
				       
				       
					<div class="fieldBox col_33">
						 <div class="label"> 产品种类：</div>
						 <div class="field">
							 <input name="prdTypCdNm" id="prdTypCdNm" type="text"  value="${prjPrd.prdTypCdNm}"  class="ui-textbox" readonly="readonly">
						</div>
					</div>
					<div class="fieldBox col_33" >
						<div class="label">车系</div>
						<div class="field">
							<input name="modelName" id="modelName" type="text"  value="${prjPrd.modelNm}"  class="ui-textbox"  readonly="readonly">
						</div>
					</div>
					<div class="fieldBox col_33" >
						<div class="label">生产集团</div>
						<div class="field">
							<input name="productionCompany" id="productionCompany" type="text"  value="${prd.productionCompany}"  class="ui-textbox"  readonly="readonly">
						</div>
					</div>


				           <%--<div class="fieldBox col_33">--%>
                                <%--<div class="label">驱动形式</div>--%>
                                <%--<div class="field"> --%>
                                 <%--<select id="drvTyp" name="drvTyp" disabled="disabled">--%>
			                     <%--<c:forEach items="${drvTypList}" var="dic" >--%>
			                    		<%--<option  value="${dic.key}"--%>
			                    		<%--<c:if test="${dic.key==prd.drvTyp}">--%>
			                    		<%--selected="selected"--%>
			                    		<%--</c:if>--%>
			                    		<%-->${dic.value }</option>--%>
			                    	<%--</c:forEach>--%>
                  				  <%--</select>--%>
                                <%--</div> --%>
                            <%--</div> --%>
				           
							   <%--<div class="fieldBox col_33">--%>
                                <%--<div class="label">马力</div>--%>
                                <%--<div class="field"> --%>
                                 <%--<select id="hp" name="hp" disabled="disabled" >--%>
			                    	<%--<c:forEach items="${hpList}" var="dic" >--%>
			                    		<%--<option  value="${dic.key }"--%>
			                    		<%--<c:if test="${dic.key==prd.hp}">--%>
			                    		<%--selected="selected"--%>
			                    		<%--</c:if>--%>
			                    		<%-->${dic.value }</option>--%>
			                    	<%--</c:forEach>--%>
                  				  <%--</select>--%>
                                <%--</div>--%>
                            <%--</div>--%>
				           
				            <div class="fieldBox col_33" >
	                        	<div class="label"> 驾驶室规格</div>
				                <div class="field">
				                	<input name="cabSpec" id="cabSpec" type="text"  value="${prd.cabSpec}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				                  <div class="fieldBox col_33" >
	                        	<div class="label"> 变速箱型号</div>
				                <div class="field">
				                	<input name="grboxMdl" id="grboxMdl" type="text"  value="${prd.grboxMdl}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
						<c:if test="${isAuditNode == '1'}">
							<c:if test="${prjTypCd =='CDDYWUL' || prjTypCd =='ESCJYD' || prjTypCd =='OWNJYD'}">
								<div class="fieldBox col_33" >
									<div class="label"> 燃料类型</div>
									<div class="field">
										<input name="fuelTypCd" id="fuelTypCd" type="text"  value="${prjPrdExt.fuelTypCd}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 主车-排放标准</div>
									<div class="field">
										<input name="emiStd" id="emiStd" type="text"  value="${prjPrdExt.emiStd}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 变速箱品牌</div>
									<div class="field">
										<input name="gerrBoxBrand" id="gerrBoxBrand" type="text"  value="${prjPrdExt.gerrBoxBrand}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 发动机品牌</div>
									<div class="field">
										<input name="styleEngine" id="styleEngine" type="text"  value="${prjPrdExt.styleEngine}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 出厂日期</div>
									<div class="field">
										<input name="releaseDate" id="releaseDate" type="text" value="<fmt:formatDate value='${prjPrd.releaseDate}' pattern='yyyy-MM-dd'/>" class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 车辆停放地</div>
									<div class="field">
										<input name="parkingLot" id="parkingLot" type="text"  value="${prdSourceInfo.parkingLot}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 车辆等级</div>
									<div class="field">
										<input name="classNm" id="classNm" type="text"  value="${prdSourceInfo.classNm}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
								<div class="fieldBox col_33" >
									<div class="label"> 评估师</div>
									<div class="field">
										<input name="surveyorNm" id="surveyorNm" type="text"  value="${prdSourceInfo.surveyorNm}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
                                <div class="fieldBox col_33" >
                                    <div class="label">车辆评估检测报告</div>
                                    <div class="field">
                                        <c:if test="${pdfFilepath != null && pdfFilepath != ''}">
                                            <a href="${pdfFilepath}" class="link" target="_blank">
                                                <span>查看报告</span>
                                            </a>
                                        </c:if>
                                    </div>
                                </div>
								<div class="fieldBox col_33" >
									<div class="label"> 驱动形式</div>
									<div class="field">
										<input name="drvTypCd" id="drvTypCd" type="text"  value="${prjPrdExt.drvTypCd}"  class="ui-textbox" readonly="readonly">
									</div>
								</div>
							</c:if>
						</c:if>
				              <div class="fieldBox col_33" >
	                        	<div class="label"> 后桥规格</div>
				                <div class="field">
				                	<input name="rearAxleSpec" id="rearAxleSpec" type="text"  value="${prd.rearAxleSpec}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				           
				            <div class="fieldBox col_33">
                                <div class="label">轮胎规格</div>
                                <div class="field">
                                    <input name="mWhlSpec" id="mWhlSpec" type="text"  value="${prd.MWhlSpec}"  class="ui-textbox" readonly="readonly">

                                </div>
                            </div>
				              <div class="fieldBox col_33" >
	                        	<div class="label"> 合格证货箱内部尺寸(长*宽*高/毫米)</div>
				                <div class="field">
				                	<input name="cntrSz" id="cntrSz" type="text"  value="${prd.cntrSz}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				               <div class="fieldBox col_66" >
	                        	<div class="label">产品型号</div>
				                <div class="field">
				                	<input name="prdMdl" id="prdMdl" type="text"  value="${dtlVO.prdMdl}"  class="ui-textbox"  readonly="readonly" >
				                	<span id="prdMdlChoose" class="sq-button sq-button-hasicon" onclick="choosePrd();"><i class="sqBtnIco_1"></i>更改</span>
				                </div>
				           </div>
				           
				             <div class="fieldBox col_33" >
	                        	<div class="label">发动机型号</div>
				                <div class="field">
				                	<input name="engMdl"  id="engMdl"  type="text"  value="${prd.engMdl}"  onblur="checkPrdMdlValue();" class="ui-textbox"  readonly="readonly">
				                </div>
				           </div> 
				           
				            <div class="fieldBox col_50" >
	                        	<div class="label">供应商名称</div>
				                <div class="field">
				                	<input name="splNm" id="splNm" type="text"  value="${prjPrd.splNm}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div> 
				             <div class="fieldBox col_50" >
	                        	<div class="label">厂商名称</div>
				                <div class="field">
				                	<input name="mfrNm" id="mfrNm" type="text"  value="${prjPrd.mfrNm}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
						<div class="caption" id="zctitle">
							<span class="title">专车</span>
						</div>
						<div class="fieldBox col_50" >
							<div class="label">车身长度(毫米)</div>
							<div class="field">
								<input name="carLen" id="carLen" type="text"  value="${prd.carLen}"  class="ui-textbox">
							</div>
						</div>
						<div class="fieldBox col_50" >
							<div class="label">车辆规模</div>
							<div class="field">
								<input name="prdLvlCd" id="prdLvlCd" type="text"  value="${prd.prdLvlCd}"  class="ui-textbox" readonly="readonly">
							</div>
						</div>
				          <div class="caption" >
                                <span class="title">上装配置</span>
                   		  </div>
                   		         <div class="fieldBox col_33" >
	                        	<div class="label">货箱(长*宽*高)</div>
				                <div class="field">
				                	<input name="actCntrSz" id="actCntrSz" type="text"  value="${prd.actCntrSz}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
                   		  	         <div class="fieldBox col_33" >
	                        	<div class="label">厚度(底*边)(毫米)</div>
				                <div class="field">
				                	<input name="thickness" id="thickness" type="text"  value="${prd.thickness}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				          <div class="fieldBox col_33" >
	                        	<div class="label">车轴品牌*数量</div>
				                <div class="field">
				                	<input name="axleInfo" id="axleInfo" type="text"  value="${prd.axleInfo}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
                   		
                   		          <div class="fieldBox col_33">
                                <div class="label">板材材质</div>
                                <div class="field"> 
                                 <select id="matQatCd" name="matQatCd" disabled="disabled" >
			                    	<c:forEach items="${matQatCdList}" var="dic" >
			                    		<option  value="${dic.key }"
			                    		<c:if test="${dic.key==prd.matQatCd }">
			                    		selected="selected"
			                    		</c:if>
			                    		>${dic.value }</option>
			                    	</c:forEach>
                  				  </select>
                                </div>
                            </div>
                            
                                      <div class="fieldBox col_33">
                                <div class="label">举升方式</div>
                                <div class="field"> 
                                 <select id="liftWayCd" name="liftWayCd" disabled="disabled" >
			                    	<c:forEach items="${liftWayCdList}" var="dic" >
			                    		<option  value="${dic.key }"
			                    		<c:if test="${dic.key==prd.liftWayCd }">
			                    		selected="selected"
			                    		</c:if>
			                    		>${dic.value }</option>
			                    	</c:forEach>
                  				  </select>
                                </div>
                            </div>
                   		  
                   		        <div class="fieldBox col_33" >
	                        	<div class="label">开门数及方式</div>
				                <div class="field">
				                	<input name="doorInfo" id="doorInfo" type="text"  value="${prd.doorInfo}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				           <c:if test="${prd.isHvWhl==1}">
				           	  <div class="fieldBox col_33">
                                <div class="label">轮胎规格*数量</div>
                                <div class="field"> 
                                 <select id="trlWhlSpec" name="trlWhlSpec" disabled="disabled" >
			                    	<c:forEach items="${trlWhlSpecList}" var="dic" >
			                    		<option  value="${dic.key }"
			                    		<c:if test="${dic.key==prd.trlWhlSpec }">
			                    		selected="selected"
			                    		</c:if>
			                    		>${dic.value }</option>
			                    	</c:forEach>
                  				  </select>
                                </div>
                            </div>
				           </c:if>
				           
                   		        <div class="fieldBox col_33" >
	                        	<div class="label">油缸规格</div>
				                <div class="field">
				                	<input name="cylSepc" id="cylSepc" type="text"  value="${prd.cylSepc}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				                 <div class="fieldBox col_33" >
	                        	<div class="label">容积(立方)</div>
				                <div class="field">
				                	<input name="tankVol" id="tankVol" type="text"  value="${prd.tankVol}"  class="ui-textbox" readonly="readonly">
				                </div>
				           </div>
				           	<div class="fieldBox col_100">
                                	<div class="label">其他</div>
	                                <div class="field">
	                              		<textarea name="othInfo" id="othInfo"    rows="4"  class="ui-textarea l-textarea" style="width:80%"  value="" readonly="readonly" >${prd.othInfo } </textarea>
	                                </div>
                            	</div>
				         
				         </div> 
                </div>
  
	 
	 <div id="btnsBox" class="btnsBox">
		 <c:if test="${isAuditNode == '1'}">
			 <c:if test="${prjTypCd =='CDDYWUL' || prjTypCd =='ESCJYD' || prjTypCd =='OWNJYD'}">
				 <span id="syncSourceDataBtn" class="sq-button sq-button-round" onclick="syncSourceDateInfo()">同步</span>
			 </c:if>
		 </c:if>
			<span id="saveBtn" class="sq-button sq-button-round" onclick="savePrjBscInfo()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
           <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
	 </div> 
	  </form>
	  <div id="prddetail" style="display: none">
		  <div class="sqCaption-normal TC">
		        <div class="tit">
		            产品明细信息
		        </div>
		    </div>
		    	<form id="prjPrdDtlForm">
		    		<div class="fieldset1 tabel_col clearFix">
		    				<div class="fieldBox col_100">
				                    <div class="label">挂靠公司</div>
				                    <div class="field">
				                     <span> 
				                    <input name="lnkCompNm" id="lnkCompNm"  type="text"  class="ui-textbox"   value="${dtlVO.lnkCompNm}" >
				                     </span>
				                     <input name="lnkCompId" id="lnkCompId" type="hidden"  value="${dtlVO.lnkCompId}" >
				                     	<span id="chooseLnkComp" class="sq-button sq-button-hasicon" onclick="choosePrjLnkComp();"><i class="sqBtnIco_1"></i>更改</span>
				                    </div>
		               		 </div>
		    	      		<div class="fieldBox col_50">
				                    <div class="label">GPS卡号1</div>
				                    <div class="field">
				                    <%--  <span id="gpsCardNo">${vehInfo.prjPrdDtl.gpsCardNo}</span> --%>
				                     	<input name="gpsCardNo"  id="gpsCardNo" type="text" class="ui-textbox"  value="${dtlVO.gpsCardNo}" >
				                    </div>
		               		 </div>
		               		 
		               		   <div class="fieldBox col_50">
				                    <div class="label">GPS卡号2</div>
				                    <div class="field">
				                    <%--  <span id="gpsCardNo2">${vehInfo.prjPrdDtl.gpsCardNo2}</span> --%>
				                	<input name="gpsCardNo2"  id="gpsCardNo2" type="text" class="ui-textbox"  value="${dtlVO.gpsCardNo2}" >
				                    </div>
		               		 </div>
		               		 </div>
		            <div id="btnsBox" class="btnsBox">
						<span id="moreBtn" class="sq-button sq-button-round"
							onclick="moreGps();" style="display:none">更多GPS卡号
						</span>
					</div>
					<div class="fieldset1 tabel_col clearFix" id="moreGps">
							<span id="addGps" class="sq-button sq-button-round" onclick="addGps();" >新增GPS卡号</span>
							<c:forEach items="${moreGpsList}" var="item">
							<div class="fieldBox col_100">
								<div class="label" style="width:13.5%;padding-left:2%">
								GPS卡号</div>
								<div class="field" style="padding-left:15%;width:58%">
										<input type="text" id="gpsCardNoMore" name="gpsCardNoMore"
										value="${item.gpsCardNo}" class="moreGps">
								</div>
								<span id="deleteButton" class="sq-button-hasicon onlyicon deleteButton" onclick="deleteGps(this);" ><i class="sqBtnIco_7"></i></span>
							</div>
							</c:forEach>
					</div>
		               		 <div id="btnsBox" class="btnsBox">
								<span id="savePrjPrdDtlBtn" class="sq-button sq-button-round" onclick="savePrjPrdDtlInfo()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
           						<span id="cancelBtn1" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
							 </div>
							 
		    	</form>
		    	</div>
	</div>
</div>
</div>


<script type="text/javascript">
var dtlId = '${dtlId}';
var tkFlag = '${tkFlag}';
var detailFlag = '${detailFlag}';
var prdTypCd = '${prdTypCd}';//产品分类
var ywParam = '${ywParam}';
var isShow = 0;
var buOrgCd = "${prj.buOrgCd}";
var prjTypCd = '${prjTypCd}';
var isAuditNode = '${isAuditNode}';
var prjId = "${prj.id}";
$(function () {
	// 专车事业部 设置carLen 必填
	if(buOrgCd){
	    // if(buOrgCd== "00000008"){
            $("#carLen").attr("validate","{required:true}");
		// }
		$("#syncSourceDataBtn").each(function(){
			$("#carLen").removeAttr("validate");
		});
	}

    $("#carLen").change(calCarLvl);
	calCarLvl();
	if(ywParam=="1"){
		$("#prddetail").hide();
	}
    if((prjTypCd == 'CDDYWUL' || prjTypCd == 'ESCJYD' || prjTypCd =='OWNJYD') && isAuditNode == '1'){
        $("#prdMdlChoose").hide();
    }
	
	 var basePrdForm1 = liger.get("basePrdForm1");
		var form = $("#basePrdForm1").ligerForm({
			validate: true
	    });
		
		 var prjPrdDtlForm = liger.get("prjPrdDtlForm");
			var prdForm = $("#prjPrdDtlForm").ligerForm({
				validate: true
		    });

		
		if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
			liger.get("prdClsCd").setDisabled(true);
		}
		
		if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
			liger.get("buyWayCd").setDisabled(true);
		}
		if(liger.get("drvTyp")&&liger.get("drvTyp")!="undefined"){
			liger.get("drvTyp").setDisabled(true);
		}
		if(liger.get("hp")&&liger.get("hp")!="undefined"){
			liger.get("hp").setDisabled(true);
		}
		if(liger.get("mWhlSpec")&&liger.get("mWhlSpec")!="undefined"){
			liger.get("mWhlSpec").setDisabled(true);
		}
		if(liger.get("matQatCd")&&liger.get("matQatCd")!="undefined"){
			liger.get("matQatCd").setDisabled(true);
		}
		if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
			liger.get("liftWayCd").setDisabled(true);
		}
		if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
			liger.get("trlWhlSpec").setDisabled(true);
		}
		
		if($("#othInfo")&&$("#othInfo")!="undefined"){
			$("#othInfo").setDisabled_ligerTextarea(true);
		}
		if(detailFlag=="true"){
			if(liger.get("prdMdl")&&liger.get("trlWhlSpec")!="undefined"){
				liger.get("prdMdl").setDisabled(true);
			}
			if(liger.get("engMdl")&&liger.get("trlWhlSpec")!="undefined"){
				liger.get("engMdl").setDisabled(true);
			}
			if(liger.get("gpsCardNo")&&liger.get("gpsCardNo")!="undefined"){
				liger.get("gpsCardNo").setDisabled(true);
			}
			if(liger.get("gpsCardNo2")&&liger.get("gpsCardNo2")!="undefined"){
				liger.get("gpsCardNo2").setDisabled(true);
			}
			if(liger.get("lnkCompNm")&&liger.get("lnkCompNm")!="undefined"){
				liger.get("lnkCompNm").setDisabled(true);
			}
			$("#prdMdlChoose").hide();
			$("#carLen").hide();
			$("#zctitle").hide();
			$("#prdLvlCd").hide();
			$("#savePrjPrdDtlBtn").hide();
			$("#cancelBtn").hide();
			$("#cancelBtn1").hide();
			$("#saveBtn").hide();
			$("#chooseLnkComp").hide();
			$("#addGps").hide();
			$("span[id='deleteButton']").each(function(){
				$(this).hide();
			});
			$("input[id='gpsCardNoMore']").each(function(){
				$(this).attr("readonly","true");
			});
		}
})
	function changeCallBack(){
	}
	function calCarLvl(){
    	var carLen = $("#carLen").val();
    	if(carLen){
    	    if(carLen < 5700 ){
    	        $("#prdLvlCd").val("轻型客车");
            }else if(carLen >= 10000){
                $("#prdLvlCd").val("大型客车");
            }else{
                $("#prdLvlCd").val("中型客车");
            }
        }
	}
	function moreGps(){
		if(isShow==0){
			$("#moreBtn").html("隐藏");
			$("#moreGps").show();
			isShow = 1;
		}else{
			$("#moreBtn").html("更多GPS卡号");
			$("#moreGps").hide();
			isShow = 0;
		}
	}

	function addGps(){
	/* gpscount++;
	$("#moreGps").append('<div class="fieldBox col_100"><div class="label" style="width:13.5%;padding-left:2%;float:left">GPS卡号</div><div style="padding-left:15%;width:41.5%;float:left"><input type="text" id="gpsCardNo'+gpscount+'" name="gpsCardNo'+gpscount+'" value="" class="moreGps"></div><span class="sq-button-hasicon onlyicon deleteButton" onclick="deleteGps();" style="margin-left:1.5%" ><i class="sqBtnIco_7"></i></span></div>'); */
		$("#moreGps").append('<div class="fieldBox col_100"><div class="label" style="width:13.5%;padding-left:2%;float:left">GPS卡号</div><div style="padding-left:15%;width:41.5%;float:left"><input type="text" id="gpsCardNoMore" name="gpsCardNoMore" value="" class="moreGps"></div><span id="deleteButton" class="sq-button-hasicon onlyicon deleteButton" onclick="deleteGps(this);" style="margin-left:1.5%" ><i class="sqBtnIco_7"></i></span></div>')
	}

	function deleteGps(owner){
		$(owner).parent().remove();
	}
  
  //取消
	function cancelBtn(){
		  var TAB=top.mainApp.parentTab;
          var currentTabid=TAB.getSelectedTabItemID();
		 top.tab.removeTabItem(currentTabid);
	}
  
	//保存项目基础信息
	function savePrjBscInfo(){
		$("#carLen").attr("validate","{required:true}");
        var ligerForm = liger.get("basePrdForm1");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var params = {};
        params.engMdl = $("#engMdl").val();
        params.prdMdl =  $("#prdMdl").val();
        params.tkFlag = tkFlag;
        params.hasCarFlag = 0;
        params.dtlId = dtlId;
        params.detailId = $("#detailId").val();
        params.prdId=$("#basePrdId").val();
        params.styleId=$("#styleId").val();
        params.carLen=$("#carLen").val();
        params.prdLvlCd=$("#prdLvlCd").val();
        params.auth = "${auth}";
        params.prdCd = $("#prdCd").val();
        params.isAuditNode = isAuditNode;
        var url = '<%=path%>/project/prjprddtl/modifyPrdDtlPrdInfo.do';
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:params,
    		url: url,
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    				 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    					var TAB=top.mainApp.parentTab;
			            var currentTabid=TAB.getSelectedTabItemID();
			            var currFrameElement=top.$("#"+currentTabid).get(0);
						 var callback=currFrameElement.W2W.callback;
		          	  		callback();
		          	 	 top.tab.removeTabItem(currentTabid); 
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
	}
	//保存挂靠公司、gps信息
	function savePrjPrdDtlInfo(){
        var ligerForm = liger.get("prjPrdDtlForm");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var params = {};
        params.gpsCardNo = $("#gpsCardNo").val();
        params.gpsCardNo2 =  $("#gpsCardNo2").val();
        params.id = dtlId;
        params.lnkCompNm = $("#lnkCompNm").val();
        params.lnkCompId=$("#lnkCompId").val();
        var moreGpsStr = "";
        $("#moreGps input").each(function(){
        	if($(this).val()!=""){
        		moreGpsStr +=$(this).val()+",";
        	}
		});
        params.moreGps = moreGpsStr;
        var url = '<%=path%>/project/prjprddtl/modify.do';
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:params,
    		url: url,
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    				 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    					var TAB=top.mainApp.parentTab;
			            var currentTabid=TAB.getSelectedTabItemID();
			            var currFrameElement=top.$("#"+currentTabid).get(0);
						 var callback=currFrameElement.W2W.callback;
		          	  		callback();
		          	 	 top.tab.removeTabItem(currentTabid); 
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
	}
    //检查产品型号是否有值
	function checkPrdMdlValue(){
		var prdMdl = $("#prdMdl").val();
		if(!prdMdl){
			 top.$.ligerDialog.SQalert({content: "请先选择产品明细信息！",SQ_type: "info"});
		}
    	
	}
	//重新更换产品型号
    function choosePrd(){
    	var prdId = $("#prdId").val();
    	// 品牌
		var brCd = $("#brCd").val(); 
		// 车系
		var model = $("#modelName").val();
		var auth = "${auth}";
        $.ligerDialog.open({ title: '产品详细信息',height: 400,width: 900, url: '<%=path%>/project/prjprddtl/toChoosePrdListPage.do?prdId='+prdId+'&&prdTypCd='+prdTypCd+'&brCd='+brCd + '&modelName='+model + '&auth='+auth, isResize: true});
    }
	
	function choosePrjLnkComp(){
        $.ligerDialog.open({  title: '更改产品挂靠公司',height: 500,width: 850, url:'<%=path%>/project/prjprdvehinfo/toChooseLnkCompPage.do'});
	}

	function syncSourceDateInfo() {
		var ligerForm = liger.get("basePrdForm1");
		if (!ligerForm.valid()) {
			top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
		}
		var ligerForm = liger.get("basePrdForm1");
		if (!ligerForm.valid()) {
			top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
		}
		var data = ligerForm.getData();
		data["prjId"] = prjId;
		data["prdbscInfoId"] = $("#prdbscInfoId").val();
		var url = '<%=path%>/project/vehicle/addPrdCarSourceDetail.do';
		var wait_dialog;
		$.ajax({
			type: 'post',
			dataType:'json',
			data:data,
			url: url,
			beforeSend: function(){
				wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			},
			success:function(msg){
				if(msg.success == 1){
					wait_dialog.close();
					top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
					var TAB=top.mainApp.parentTab;
					var currentTabid=TAB.getSelectedTabItemID();
					TAB.reload(currentTabid);
					var currFrameElement=top.$("#"+currentTabid).get(0);
					var callback=currFrameElement.W2W.callback;
					callback();
					top.tab.removeTabItem(currentTabid);
				}else{
					wait_dialog.close();
					UIUtils.alertError(msg.info);
				}
			}
		});
	}
</script>
<div class="ClearLine"></div>
</body>
</html>
